Page({
  data: {
    headerLayout: {
      title: "我的",
      paddingBottom: 25
    },

    user: {
      name: "微信用户",
      avatar: "https://source.unsplash.com/54x54/?men"
    },

    iconList: [{
      label: "我的报名",
      svgUrl: "signup",
      pageUrl: "signup",
      width: "36px",
      height: "36px"
    }, {
      label: "我的收藏",
      svgUrl: "favorite",
      // pageUrl: "favorite",
      width: "30px",
      height: "24.143px"
    }, {
      label: "校园验证",
      svgUrl: "verification",
      // pageUrl: "verification",
      width: "30px",
      height: "22.286px"
    }, {
      label: "活动发布",
      svgUrl: "post",
      // pageUrl: "post",
      width: "32px",
      height: "29px"
    }],

    // infoTip: {
    //   url: "https://source.unsplash.com/57x57/?coding",
    //   title: "机械科协 | 天津市大学生知识产权创新设...",
    //   description: {
    //     left: "距离活动开始还有",
    //     center: "1",
    //     right: "天"
    //   }
    // },


    listLayout: [
      {
        label: "问题反馈",
        openButton: "feedback",
      }, {
        label: "联系我们",
        openButton: "contact",
      },
      // {
      //   label: "退出登录"
      // }
    ],


    footerLayout: [
      {
        url: "home/index",
        label: "主页",
        icon: "home"
      }, {
        url: 'activity/index',
        label: "动态",
        icon: "activity"
      },
      //   {
      //   url: 'help/index',
      //   label: "互助",
      //   icon: "help"
      // }, {
      //   url: 'portal/index',
      //   label: "传送",
      //   icon: "portal"
      // },
      {
        url: "me/index",
        label: "我的",
        icon: "me"
      }
    ]
  },
  listTap(e) {
    const index = e.currentTarget.dataset.index;
    if (this.data.listLayout[index].onTap)
      this.data.listLayout[index].onTap(e);
  },
  onIconItemTap(e) {
    if (this.data.iconList[e.currentTarget.dataset.iconItemIndex].pageUrl) {
      wx.navigateTo({
        url: `../me-${this.data.iconList[e.currentTarget.dataset.iconItemIndex].pageUrl}/index`,
        fail: console.log
      })
    } else {
      wx.showToast({
        icon: "error",
        title: "开发中"
      })
    }
  }
})
